<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改检索排除')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-searchWordExclude-edit" th:object="${searchWordExclude}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">搜索范围：</label>
                    <div class="col-sm-5">
                        <select name="searchField" class="form-control" th:with="type=${@dict.getType('search_field')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{searchField}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">排除关键字：</label>
                    <div class="col-sm-5">
                        <input name="exWord" th:field="*{exWord}" class="form-control" type="text">
                    </div>
                    <label class="col-sm-4 control-label" style="text-align: left">*多个文字用逗号隔开；为空时包含分类下所有事件，且二级分类不能为空</label>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/searchWordExclude";
        $("#form-searchWordExclude-edit").validate({
            onkeyup: false,
            rules:{
                exWord:{
                    required: true,
                    minlength: 1,
                    maxlength: 20
                }
            },
            messages: {
            },
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-searchWordExclude-edit').serialize());
            }
        }

        $("input[name='addTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>